<!--
 * @Description:首页
 * @Version: 2.0
 * @Author: zhao
 * @Date: 2022-06-13 14:37:16
 * @LastEditors: zhao
 * @LastEditTime: 2022-07-08 10:44:20
-->
<!--  -->
<template>
    <div class="home" :style="home_height">
        <zRoll />
        <div class="home_img">
            <!-- <el-carousel height="500px">
      <el-carousel-item v-for="item in 4" :key="item">
        <h3 class="small">{{ item }}</h3>
      </el-carousel-item>
    </el-carousel> -->
            <!-- <h1>珍惜自然资源 呵护美丽国土</h1> -->
            <!-- <zsearch :searchProps="{ width: '800px', IsSeniorSearch: true }" ref="zsearch" /> -->
            <div class="tiao">
                <div class="search" :style="{ width: '14.8rem' }">
                    <div class="search_input" @keyup.enter="search()">
                        <el-input v-model="formInline.Title" placeholder="请输入档案名称/档案号">
                            <div slot="append" @click="search()">搜索</div>
                        </el-input>
                        <!-- <span class="cursor" style="margin: 0 10px" @click="setAdvanced()">高级搜索</span> -->
                        <!-- <span class="SpatialRetrieval cursor" @click="$router.push('/SpatialRetrieval')">空间检索</span> -->
                    </div>
                </div>
            </div>
        </div>

        <div class="center">
            <div class="center_left">
                <!-- <h2>资料馆简介</h2> -->
                <p class="">
                    根据自然资源部进一步加强地质资料社会化服务的要求，河北省自然资源档案馆持续推进地质资料信息开放共享，在全面梳理馆藏地质资料服务资源，完成馆藏地质资料目录信息采编并向社会公开的同时，开展基于“互联网+地质资料服务”的新型网络服务工作，对原“省馆目录”查询功能进行升级，实现“网络订单”功能，以实际行动切实做好地质资料社会化服务利用。
                </p>
                <!-- <p class="cursor jump" @click="$router.push('/AboutUs')">
                    <span>查看更多</span>
                </p> -->
            </div>
            <div class="center_right">
                <!-- <img src="../../assets/home.jpg" alt="" /> -->
                <img src="../../assets/home/未标题-2.png" alt=""  align="right">
            </div>
        </div>
    </div>
</template>

<script>
import zsearch from "@/components/zSearch/index.vue"
import zList from "@/components/zList/index.vue"
import zRoll from "@/components/zRoll"

export default {
    name: "Home",

    components: { zsearch, zList, zRoll },
    data() {
        return {
            catalogueHeaderData: {
                index: "序号",
                name: "资料名称",
                date: "形成时间",
            },
            catalogueType: {
                title: "title",
                date: "formDate",
            },
            catalogueTotal: "",

            NavName: {
                province: "",
                city: "",
                area: "",
            },

            PublicityHeaderData: {
                index: "序号",
                name: "公告名称",
                date: "发布时间",
            },
            PublicityType: {
                title: "title",
                date: "updateTime",
            },
            PublicityTotal: "",
            HomeNumber: {},
            menuData: [],
            Category: "",

            formInline: {},
            home_height: "height: calc(100vh - 166px)",
        }
    },

    computed: {},
    NavName: {
        handler: function (val, oldVal) {
            // this.getCategory()
        },
        immediate: true,
        deep: true,
    },
    mounted() {
        this.$store.state.map.mapList = []
        this.$store.state.table.searchData = {
            pageSize: 10,
            pageIndex: 1,
        }
        this.$store.state.search.isOpen = false
        this.$set(this.NavName, "province", "河北省")
        // this.getHomeNumber()
        // this.getCategory()
        this.$store.state.map.mapList = []
        this.AddbrowseNumber()

        // window.onresize = function () {

        //     this.home_height = "height: calc(100vh - 166px)"
        // }
    },

    methods: {
        handleOpen(key, keyPath) {},
        handMenu(val) {
            this.Category = val
        },
        handleClose(key, keyPath) {},
        open(url) {
            this.$router.push(url)
        },
        closureNav() {
            this.$nextTick(() => {
                this.$refs.znav.closure()
            })
        },
        setNav(nav) {
            this.NavName.province = nav.province
            this.NavName.city = nav.city
            this.NavName.area = nav.area
            this.getArchive()
            // this.getCategory()
        },
        getTotal(data) {
            if (data.url == "getGeodatainfoArchive") this.catalogueTotal = data.total
            if (data.url == "getNoticeList") this.PublicityTotal = data.total
        },
        async getArchive() {
            // let Archivedata = {
            //     pageSize: 10,
            //     pageIndex: 1,
            //     Category: "",
            //     Area: [this.NavName.province, this.NavName.city, this.NavName.area],
            // }
            // const { data } = await this.$store.dispatch("ArchiveInfo/getGeodatainfoArchive", Archivedata)
            // this.catalogueListData = data
        },
        async getHomeNumber() {
            const { data } = await this.$store.dispatch("ArchiveInfo/getHomeNumber")

            this.HomeNumber = data
        },
        // 首页，左侧导航的地质资料类别
        async getCategory() {
            let val = {
                Area: [this.NavName.province || "", this.NavName.city || "", this.NavName.area || ""],
            }
            const { data } = await this.$store.dispatch("ArchiveInfo/getCategory", val)
            this.menuData = data
        },
        search() {
            // this.$store.state.table.searchData = this.formInline

            let data = {
                pageSize: 10,
                pageIndex: 1,
                Title: this.formInline.Title,
            }
            this.$router.push({ name: "AttributeQuery", params: data })
        },
        setAdvanced() {
            this.$store.state.search.isOpen = true
            this.$router.push("/AttributeQuery")
        },
        async AddbrowseNumber() {
            const { data } = await this.$store.dispatch("ArchiveInfo/AddbrowseNumber")
        },
    },
}
</script>
<style lang='scss' scoped>
//   .el-carousel__item h3 {
//     color: #475669;
//     font-size: 14px;
//     opacity: 0.75;
//     line-height: 150px;
//     margin: 0;
//   }

//   .el-carousel__item:nth-child(2n) {
//      background-color: #99a9bf;
//   }
  
//   .el-carousel__item:nth-child(2n+1) {
//      background-color: #d3dce6;
//   }


.home {
    background: white;

    width: 100vw;
    overflow: hidden;
    overflow-y:scroll
}

.center {
    height: calc(100% - 7rem);
    padding: var(--main-padding);
    display: flex;
    padding-bottom: 120px;

    .center_left {
        width: 50%;
        padding: 60px 30px 60px 120px ;
        margin-left: 90px;

        p {
            text-indent: 2em;
            font-size: 26px;
            line-height: 2;
            width: 700px;
            text-align: justify;
            

            span {
                font-size: 21px;
                font-weight: 600;
                color: #409eff;
            }
        }
    }

    .center_right {
        width: 50%;
        padding: 60px;
        
        img {
            // width: 100%;
            height: 410px;
            margin-right: 0px;
            max-width:100%;
        }
    }
}

.home_img {
    width: 100vw;
    height: 490px;
    min-height: 5rem;
    background: url(../../assets/home/未标题-1.png) no-repeat;
    // background: url(../../assets/home.png) no-repeat;
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    
    h1 {
        color: white;
        padding: 30px 0;
        font-weight: 400;
        font-size: 60px;
    }
}

// .tiao {
//     display: flex; 
//     position: absolute;
//     z-index:999;
//     align-items: center;
//     justify-content: center;
//     flex-direction: column;
//     margin-top: -400px;
//     margin-left: 800px;

// }

.list {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.33rem;
    padding-bottom: 20px;

    .list_title {
        text-align: center;

        h2 {
            margin: 40px 0 30px 0;
        }

        .span {
            width: 50px;
            height: 5px;
            background-color: #1f529e;
            display: inline-block;
            margin: 40px 0 0;
        }

        .list_title_span {
            font-size: 0.4rem;
            font-weight: 700;
        }
    }

    .list_cont {
        border: 1px solid #eee;
        width: 1800px;

        .list_cont_top {
            padding: 20px 20px;
            font-size: 20px;
            display: flex;
            justify-content: space-between;

            div {
                display: flex;
                align-items: center;
            }

            h4 {
                color: #1f529e;
                font-size: 0.4rem;
                float: left;
                padding-left: 20px;
                margin: 0;
            }
        }

        .list_cont_bottom {
            display: flex;
            justify-content: center;

            li {
                font-size: 0.296rem;
            }

            .el-menu-item {
                background: #cfe2ff !important;
                margin-bottom: 10px;
                color: #02409c;
            }
        }

        .cursor:hover {
            color: rgb(50, 145, 248);
        }
    }
}

.search {
    .search_input {
        display: flex;
        justify-content: space-around;
        align-items: center;
        margin-top: 90px;
        

        span {
            width: 1.7rem;
            background: #1b50a0;
            color: #fff;
            font-size: 0.32rem;
            text-align: center;
            padding: 15px 5px;
        }
    }

    .search_button {
        .el-form-item {
            width: 100% !important;
            border: 1px solid #eee;
            margin-bottom: 0;
            padding: 10px 0;

            .el-button {
                margin: 0 10px;
            }
        }
    }

    .search_input .el-input {
        height: 60px;
        width: calc(100% - 200px);

        ::v-deep .el-input__inner {
            height: 100%;
            // border-radius: 25px;
            // border-top-right-radius: 0;
            // border-bottom-right-radius: 0;
        }

        ::v-deep .el-input-group__append {
            width: 100px;
            background: #1b50a0;
            color: #fff;
            font-size: 24px;
            text-align: center;
        }

        ::v-deep.el-input-group__append:hover {
            cursor: pointer;
        }
    }

    // .SpatialRetrieval {
    //     border-bottom: 1px solid $text_color;
    //     text-decoration: underline;
    // }
    //查询框
    .SeniorSearch {
        margin: 10px 0;
        padding: 20px 10px;
        border: 1px solid #ccc;
        background: #fafcff;

        .search_button {
        }

        .languages {
            .el-select {
                padding: 0 10px;
            }

            .el-button {
                padding: 10px 30px;
            }
        }

        .el-form-item {
            width: 30%;
            background: white;

            ::v-deep .el-form-item__content {
                width: calc(100% - 1.5rem);

                .el-input {
                    width: 100%;
                }

                .el-select {
                    width: 100%;
                }

                .el-cascader {
                    width: 100%;
                }

                .el-date-editor {
                    width: 100%;
                }
            }
        }
    }

    //按钮颜色
    .el-button--goon {
        color: white;
        background: #9ec8f9;
        border-color: #9ec8f9;
    }

    .el-button--goon:focus,
    .el-button--goon:active,
    .el-button--goon:hover {
        color: white;
        background: #9ec8f9;
        border-color: #9ec8f9;
    }

    .el-button--goon.is-plain {
        color: #333;
        background-color: white;
        border-color: white;
    }

    // .el-button--goon.is-plain:focus,
    .el-button--goon.is-plain:active,
    .el-button--goon.is-plain:hover {
        color: white;
        background: #9ec8f9;
        border-color: #9ec8f9;
    }
}

.jump {
    float: right;

    span {
        border: 1px solid #eee;
        border-radius: 20px;
        padding: 10px 20px;
        text-align: center;
    }
}
</style>
